<template>
	<view class="goodslist">
		<view class="goodsItem" v-for="item in goodsList" :key="item.id">
			<view class="goodsImg">
				<image :src="imgH+item.img" :lazy-load="true"></image>
			</view>
			<view class="content">
				<view class="name">{{item.name}}</view>
				<view class="reward">
					<view class="cell pinkCell" v-if="item.act&&item.act.cashReward&&saleType!==5">
						分享立赚￥{{item.act.cashReward.split('_')[1]}}
					</view>
					<view class="cell orgCell" v-if="item.act&&item.act.voucherReward&&saleType!==5">
						分享送换购券￥{{item.act.voucherReward.split('_')[1]}}
					</view>
					<view class="cell" v-else></view>
				</view>
				<view class="boBox">
					<view class="left">
						<view class="price">¥{{item.nowPrice?item.nowPrice:'0.00'}}</view>
						<view class="flBox">
							<view class="cell greenCell" v-if="item.act&&item.act.maxCoupon&&saleType!==5">
								可用优惠券￥{{item.act.maxCoupon}}
							</view>
							<view class="cell greenCell" v-if="item.act&&item.act.maxVoucher&&saleType!==5">
								可用换购券￥{{item.act.maxVoucher}}
							</view>
							<view class="cell" v-else></view>
						</view>
					</view>
					<view class="right">
						<image src="../../static/index/share.png"></image>
						<view class="desc">分享给好友</view>
					</view>
				</view>
				<view class="shop" v-if="showShop">
					<view class="shopName">{{item.shopEntity?item.shopEntity.name:'社集优选自营店'}}</view>
					<view>进店></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:'goods-list',
		props:{
			goodsList:Array,
			saleType:{
				type:Number,
				default: 0
			},
			showShop:{
				type:Boolean,
				default:true
			},
		},
		data() {
			return {
				imgH:'http://images.zmzpl.com/'
			};
		},
		methods:{

		}
	}
</script>

<style lang="stylus" scoped>
.goodslist
	margin-top 20rpx
	padding 0 20rpx
	display flex
	justify-content space-between
	flex-wrap wrap
	.goodsItem
		border-radius 10px
		width 350rpx
		height 592rpx
		background-color: #fff
		margin-bottom 20rpx
		.goodsImg
			width: 350rpx;
			height: 350rpx;
			image
				border-radius 10px 10px 0 0
				width: 350rpx;
				height: 350rpx;
		.content
			padding 0 20rpx
			.name
				white-space nowrap
				overflow hidden
				text-overflow ellipsis
				color #343434
				font-size 11px
				height 60rpx
				line-height 60rpx
			.reward
				display flex
			.cell
				font-size 8px
				height 20rpx
				line-height 20rpx
				padding 0 6rpx
				border-radius 2px
			.pinkCell
				color #E43A60
				border 1rpx solid #E43A60
				margin-right 10rpx
			.orgCell
				color #F59F12
				border 1rpx solid #F59F12
			.greenCell
				color #81B72F
				border 1rpx solid #81B72F
			.boBox
				display flex
				justify-content space-between
				margin-top 11rpx
				.left
					flex 1
					.price
						color #00A48F
						font-size 18px
					.flBox
						margin-top 6rpx
						display flex
				.right
					text-align center
					padding-top 8rpx
					height 70rpx
					image
						width: 40rpx;
						height: 40rpx;
					.desc
						color #00A398
						font-size 9px
			.shop
				flex-wrap nowrap
				color #666666
				font-size 9px
				display flex
				height 60rpx
				line-height 60rpx
				margin-top 10rpx
				.shopName
					flex 1
					white-space nowrap
					overflow hidden
					text-overflow ellipsis
					margin-right 10rpx
			
						
</style>
